// SocketUtil.h: interface for the SocketUtil class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SOCKETUTIL_H__B79162D5_226F_4666_8806_83A09E58F685__INCLUDED_)
#define AFX_SOCKETUTIL_H__B79162D5_226F_4666_8806_83A09E58F685__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>


BOOL SafeSend(SOCKET sock, const char* pBuf, int nLen);
BOOL SafeRecv(SOCKET sock, char*pBuf, int nLen);
BOOL ConnectHasTimeout(SOCKET sock, struct sockaddr_in *pAddr, int nTimeOut);
BOOL WaitForSockCanRead(SOCKET sock, int nTimeOut = 1000);
BOOL WaitForSockCanWrite(SOCKET sock, int timeout);
int sock_setReadTimeout(SOCKET sock, int timeout);
int sock_setWriteTimeout(SOCKET sock, int timeout);
int sock_setTimeout(SOCKET sock, int op, int timeout);

#endif // !defined(AFX_SOCKETUTIL_H__B79162D5_226F_4666_8806_83A09E58F685__INCLUDED_)
